package cn.laixueit.exception;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice

public class MyException2 {

    @ExceptionHandler(StudentException.class)
//    @ResponseBody
    public String ex(Model model){
        model.addAttribute("err","注解error");
        return "error";
    }

}
